import request from '@/utils/request'

// 生成分享码
export function getShareCode() {
  return request({
    url: '/share/codes//getShareCode',
    method: 'get'
  })
}

// 查询分享码列表
export function listCodes(query) {
  return request({
    url: '/share/codes/list',
    method: 'get',
    params: query
  })
}

// 查询分享码详细
export function getCodes(shareId) {
  return request({
    url: '/share/codes/' + shareId,
    method: 'get'
  })
}

// 新增分享码
export function addCodes(data) {
  return request({
    url: '/share/codes',
    method: 'post',
    data: data
  })
}

// 修改分享码
export function updateCodes(data) {
  return request({
    url: '/share/codes',
    method: 'put',
    data: data
  })
}

// 删除分享码
export function delCodes(shareId) {
  return request({
    url: '/share/codes/' + shareId,
    method: 'delete'
  })
}
